//
//  STDatePickerView.h
//
//  Created by yls on 14-2-25.
//  Copyright (c) 2014 yls. All rights reserved.
//
// http://git.oschina.net/yanglishuan/STDatePickerView
//

#import <UIKit/UIKit.h>

@interface STDatePickerView : UIView

@property (nonatomic, strong, readonly) UIDatePicker *datePicker;   ///< datePicker
@property (nonatomic, strong) NSDate *date;      ///< default is now
@property (assign, nonatomic, readonly) BOOL isShow;    ///< datePickerView is show

/** 初始化并显示日期选择视图 */
+ (STDatePickerView *)showInView:(UIView *)view animated:(BOOL)animated;
+ (STDatePickerView *)showInView:(UIView *)view date:(NSDate *)date animated:(BOOL)animated;

/** 显示日期选择视图 */
- (void)show:(BOOL)animated;
/** 隐藏日期选择视图 */
- (void)dismiss:(BOOL)animated;

/**显示完成事件 */
- (void)onShowFinish:(void(^)(STDatePickerView *pickerView))showFinish;
/**隐藏完成事件 */
- (void)onHideFinish:(void(^)(STDatePickerView *pickerView))hideFinish;

/** 确定事件 */
- (void)onDone:(void(^)(STDatePickerView *pickerView))done;
/** 取消事件 */
- (void)onCancel:(void(^)(STDatePickerView *pickerView))cancel;
/** 日期变动事件 */
- (void)onDateChanged:(void(^)(STDatePickerView *pickerView, NSDate *date))dateChangedBlock;

@end
